package com.huanong.service.impl;

import com.huanong.mapper.AdminMapper;
import com.huanong.pojo.Admin;
import com.huanong.service.AdminService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class AdminServiceImpl implements AdminService {

    @Autowired
    private AdminMapper adminMapper;

    @Override
    public boolean isCheckAccount(String account) {
        Admin admin = adminMapper.queryAdminByAccount(account);
        if (admin == null) {
            return true;
        }
        return false;
    }

    @Override
    public Admin queryPasswordByAccount(String anAccount) {
        return adminMapper.queryAdminByAccount(anAccount);
    }

    @Override
    public void register(Admin admin) {
        adminMapper.register(admin);
    }
}

